﻿using System;
using System.Collections.Generic;
using WinRTFramework.Common;
using WinRTFramework.Interfaces.AppStates;
using WinRTFramework.Interfaces.Contracts.Search;
using WinRTFramework.Interfaces.Contracts.Settings.ViewModel;
using WinRTFramework.Interfaces.Contracts.Sharing;
using WinRTFramework.Interfaces.Navigation;
using WinRTFramework.Interfaces.Navigation.ViewModel;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Search;

namespace WinRTFramework.DefaultImplementations
{
    /// <summary>
    /// 
    /// </summary>
    public class DefaultPageViewModel : Bindable, 
                                        ISupportTransientState, 
                                        ICareAboutNavigationFlow, 
                                        IRequireNavigationService,
                                        ICareAboutSuspendResume, 
                                        ISupportSearchContract,
                                        ISupportContextSpecificSettings,
                                        IRequireSharingService,
                                        ISupportSharingSourceContract
    {
        #region ICareAboutNavigationFlow
        virtual public void OnNavigatedTo(object navigationParameter)
        {            
        }

        virtual public void OnNavigatingFrom()
        {
        }

        virtual public void OnNavigatedFrom()
        {
        }
        #endregion

        #region IRequireNavigationService
        public INavigationService NavigationService
        {
            get;
            set;
        }
        #endregion

        #region ISupportTransientState
        virtual public void UpdateTransientState(object state)
        {        }

        virtual public object GetTransientState()
        {
            return null;
        }

        virtual public IEnumerable<Type> GetTransientStateTypes()
        {
            yield break;
        }
        #endregion

        #region ICareAboutSuspendResume
        virtual public void Suspending()
        {
        }

        virtual public void Resumed(object navigationParameter, Common.ResumePreviousAppState previousAppState)
        {
        }
        #endregion

        #region ISupportSearchContract
        virtual public void ProcessQueryText(SearchPaneQuerySubmittedEventArgs args)
        {}

        virtual public void OnSearchPaneSuggestionsRequested(SearchPaneSuggestionsRequestedEventArgs args)
        { }
        #endregion

        #region ISupportContextSpecificSettings
        virtual public IEnumerable<ISupportSettingsFlyout> GetSettingsFlyoutViewModels()
        {
            yield break;
        }
        #endregion

        #region IRequireSharingService

        public ISharingService SharingService { get; set; }

        #endregion

        #region ISupportSharingSourceContract
        
        virtual public void OnShareRequested(DataRequest dataRequest)
        {}

        #endregion
    }
}
